package utils

import (
	"crypto/md5"
	"encoding/hex"
	"math/rand/v2"
)

func IntRange(min, max int) int {
	if min == max {
		return min
	}
	rng := rand.New(rand.NewPCG(rand.Uint64(), rand.Uint64()))
	return rng.IntN(max-min) + min
}
func ComputeMD5(str string) string {
	hash := md5.New()
	hash.Write([]byte(str))
	return hex.EncodeToString(hash.Sum(nil))
}
